﻿using System;
using System.Collections.Generic;
using Microsoft.BusinessData.MetadataModel;
using Microsoft.BusinessData.MetadataModel.Collections;

namespace BdcRestConnector.Tests
{
    public class MyTypeDescriptors : ITypeDescriptorCollection
    {
        private readonly List<ITypeDescriptor> _col;

        public MyTypeDescriptors(params ITypeDescriptor[] tds)
        {
            _col = new List<ITypeDescriptor>(tds);
        }

        public bool Contains(ITypeDescriptor item)
        {
            throw new NotImplementedException();
        }

        public void CopyTo(ITypeDescriptor[] array, int arrayIndex)
        {
            throw new NotImplementedException();
        }

        public int Count
        {
            get { return _col.Count; }
        }

        public ITypeDescriptor this[int index]
        {
            get { return _col[index]; }
        }

        public IEnumerator<ITypeDescriptor> GetEnumerator()
        {
            return _col.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return _col.GetEnumerator();
        }
    }
}
